﻿@using ZhouYu.DreamTour.Model;
@using ZhouYu.DreamTour.ViewModel;
@using ZhouYu.DreamTour.Web.Models;
@{
    //根据Id获取地方特产信息
    Goods goods = Model as Goods;
    //地方特产页面图片展示
    var SpecialtyPicture = ViewBag.SpecialtyPicture as List<Picture>;
    //根据商品Id查询商品发货地
    var CheckStartPlace = ViewBag.CheckSuAddress as Supplier;
    //根据用户Id查询商品配送地址
    var CheckDeliAdress = ViewBag.CheckDeliAdress as DeliveryAddress;
    string Delivery_Adress = "";
    if (CheckDeliAdress != null)
    {
        Delivery_Adress = CheckDeliAdress.Delivery_Adress.Substring(0, 2);
    }
    //根据订单类型和商品名称查询销售量
    var GetSalesCount = ViewBag.GetSalesCount as ResponseResult;
    //根据商品Id获取地方特产详情信息
    var GetGoodsDetailsInfo = ViewBag.GetGoodsDetailsInfo as GoodsDetails;
    //计算特产的有效期
    TimeSpan days = GetGoodsDetailsInfo.ValidityTime - GetGoodsDetailsInfo.ProductDate;
    //查询用户平均点评分数
    var CheckAvgScore = ViewBag.CheckAvgScore as Usercomment;
    //调用查询特产评论数
    var CheckUserCommentCount = ViewBag.CheckUserCommentCount;
    //调用获取商品评论列表
    var GetUsercommentsList = ViewBag.GetUsercommentsList as List<Usercomment>;
    var UserInfo = UserInfoContext.userInfoContext.UserInfo;
}
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>中国梦想游--地方特产详情页</title>
    <link href="~/css/style.css" rel="stylesheet" type="text/css" />
    <link href="~/css/common.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="~/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="~/js/Format.js"></script>
    <script type="text/javascript">

        $(function () {
            var wweya_li = $("div.tab_menu ul li");
            wweya_li.click(function () {
                $(this).addClass("selected")
                    .siblings().removeClass("selected");
                var index = wweya_li.index(this);
                $("div.tab_box > div")
                    .eq(index).show(100)
                    .siblings().hide();
            }).hover(function () {
                $(this).addClass("hover");
            }, function () {
                $(this).removeClass("hover");
            });
        });
    </script>
</head>
<body>
    <div class="top_hw clearfix">
        <div class="top_h clearfix">
            <div class="top_hl"><span>欢迎来到中国梦想游，让你的梦想全程免费自由行！</span> 预定热线：<b>0571-63322269</b></div>
            <div class="top_hr">
                @if (UserInfo == null)
                {
                    <a href="/Home/User_Register">会员注册</a>
                    <span>|</span> <a href="/Home/User_Login">登录</a>
                    <span>|</span> <a href="#">梦想收藏</a> <span>|</span> <a href="#">设为首页</a>
                    @*<a>
                            欢迎你，来到新世界旅行网！
                        </a>*@
                }
                else
                {
                    <a href="/Home/User_Center">会员中心</a>
                    <span>|</span> <a href="#">梦想收藏</a> <span>|</span> <a href="#">设为首页</a> <span>|</span> <a href="/Login/LoginOut">退出</a> <span>|</span>
                    <a>
                        欢迎你，<span>@UserInfo.User_Name</span>来到新世界旅行网！
                    </a>
                }
            </div>
        </div>
    </div>
    <div class="head_w">
        <div class="head_t clearfix">
            <div class="logo"><img src="~/images/logo.jpg"></div>
            <div class="rx_line"><img src="~/images/rx.jpg"></div>
        </div>
    </div>
    <div class="mainNav clearfix">
        <ul class="Nav_ul">
            <li><a href="/Home/Index">首页</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Route">旅游路线</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Scenic">旅游景点</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/CateringAccommodation">餐饮住宿</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Traffic_DatailsOne">交通线路</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Group">旅游团购</a><img src="~/images/nav_line.jpg"></li>
            <li class="cur"><a href="/Home/Specialty">地方特产</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/AutoGenerationIntro">自动生成简介</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Team_Join">团队简介</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Itinerary_Details">行程导航</a></li>
        </ul>
    </div>
    <div class="b_wrap">
        <div class="current"><span>当前所在地：</span><a href="/Home/Index">首页</a> >> <a href="/Home/Specialty">地方特产</a>>> <a href="#">商品详情</a> </div>
        <div class="clumn_w clearfix">
            <div class="clumn_l">
                <div class="clumn">
                    <div class="clumn_tit t01">餐饮住宿</div>
                    <div class="clumn_con">
                        <div class="cln_w">
                            <p>华北</p>
                            <div class="cln_c clearfix">
                                <a href="#">北京特产</a>
                                <a href="#">天津特产</a>
                                <a href="#">河北特产</a>
                                <a href="#">山西特产</a>
                                <a href="#">内蒙古特产</a>
                            </div>
                        </div>
                        <div class="cln_w">
                            <p>西北</p>
                            <div class="cln_c clearfix">
                                <a href="#">宁夏特产</a>
                                <a href="#">新疆特产</a>
                                <a href="#">青海特产</a>
                                <a href="#">陕西特产</a>
                                <a href="#">甘肃特产</a>
                            </div>
                        </div>
                        <div class="cln_w">
                            <p>西北</p>
                            <div class="cln_c clearfix">
                                <a href="#">四川特产</a>
                                <a href="#">云南特产</a>
                                <a href="#">贵州特产</a>
                                <a href="#">西藏特产</a>
                                <a href="#">重庆特产</a>
                            </div>
                        </div>
                        <div class="cln_w">
                            <p>华中</p>
                            <div class="cln_c clearfix">
                                <a href="#">湖北特产</a>
                                <a href="#">湖南特产</a>
                                <a href="#">河南特产</a>
                            </div>
                        </div>
                        <div class="cln_w">
                            <p>华南</p>
                            <div class="cln_c clearfix">
                                <a href="#">广东特产</a>
                                <a href="#">广西特产</a>
                                <a href="#">海南特产</a>
                            </div>
                        </div>
                        <div class="cln_w">
                            <p>东北</p>
                            <div class="cln_c clearfix">
                                <a href="#">辽宁特产</a>
                                <a href="#">吉林特产</a>
                                <a href="#">黑龙江特产</a>
                            </div>
                        </div>
                        <div class="cln_w">
                            <p>港澳台</p>
                            <div class="cln_c clearfix">
                                <a href="#">香港特产</a>
                                <a href="#">澳门特产</a>
                                <a href="#">台湾特产</a>
                            </div>
                        </div>
                        <div class="cln_w">
                            <p>华东</p>
                            <div class="cln_c clearfix">
                                <a href="#">山东特产</a>
                                <a href="#">江苏特产</a>
                                <a href="#">江西特产</a>
                                <a href="#">安徽特产</a>
                                <a href="#">浙江特产</a>
                                <a href="#">福建特产</a>
                                <a href="#">上海特产</a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clumn">
                    <div class="clumn_tit t03"><span>游览历史记录</span><a href="#">更多>></a></div>
                    <div class="clumn_con">
                        <ul class="clu_ul s_ul">
                            <li><a href="#">日本航空·大阪自由行5日    </a><span>¥3152</span></li>
                            <li><a href="#">日本航空·名古屋自由行4日  </a><span>¥3129</span></li>
                            <li><a href="#">购物·东京涉谷原宿自由行5日</a><span>¥5880</span></li>
                            <li><a href="#">日本航空·大阪自由行5日    </a><span>¥3152</span></li>
                            <li><a href="#">日本航空·名古屋自由行4日  </a><span>¥3129</span></li>
                            <li><a href="#">购物·东京涉谷原宿自由行5日</a><span>¥5880</span></li>
                            <li><a href="#">日本航空·大阪自由行5日    </a><span>¥3152</span></li>
                            <li><a href="#">日本航空·名古屋自由行4日  </a><span>¥3129</span></li>
                            <li><a href="#">购物·东京涉谷原宿自由行5日</a><span>¥5880</span></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="clumn_r">
                <div class="tc_tit">商品详情</div>
                <div class="xq_wrap clearfix">
                    <div class="xq_left">
                        @foreach (var picture in SpecialtyPicture)
                        {
                            if (goods.GoodsId == picture.GoodsId && picture.Is_Master == 0 && picture.Pic_Status == 1)
                            {
                                <img src="@picture.PictureUrl">
                            }
                        }
                    </div>
                    <div class="xq_right">
                        <div class="xq_detail">
                            <p class="xq_t"><b>@goods.GoodsName</b></p>
                            <p class="xq_xs"><span>@goods.Describe</span></p>
                            <p><b>优惠价：<span>¥ @goods.Discount</span></b></p>
                            <p class="zg_price">专柜价格 ¥ @goods.Price</p>
                            <p>净含量： @goods.Weight </p>
                            <p>
                                配送：@CheckStartPlace.StartPlace 至
                                @if (Delivery_Adress == "")
                                {
                                    <span style="color:black">深圳</span>
                                }
                                else
                                {
                                    @Delivery_Adress
                                }
                            </p>
                            <p>销量： @GetSalesCount.data 件  </p>
                            <p>
                                评价：
                                @if (goods.GoodsId == CheckAvgScore.UserComment_PruId)
                                {
                                    @Math.Round(Convert.ToDouble(CheckAvgScore.UserComment_Score), 1);
                                    <span style="color:black">分</span>
                                }
                                else
                                {
                                    <span>暂无评分</span>
                                }
                                
                                累计评价 @CheckUserCommentCount
                            </p>


                        </div>


                        <div class="share">
                            <img src="~/images/share.jpg" align="absmiddle">分享给朋友：
                            <a href="#"><img src="~/images/s01.jpg" align="absmiddle"></a>
                            <a href="#"><img src="~/images/s02.jpg" align="absmiddle"></a>
                            <a href="#"><img src="~/images/s03.jpg" align="absmiddle"></a>
                            <a href="#"><img src="~/images/s04.jpg" align="absmiddle"></a>
                            <a href="#"><img src="~/images/s05.jpg" align="absmiddle"></a>
                            <a href="#"><img src="~/images/s06.jpg" align="absmiddle"></a>
                        </div>
                        <div class="xq_button"><a href="/Home/Specialty_Products?GoodsId=@goods.GoodsId"><img src="~/images/buy_button.jpg"></a> @*<a href="/Home/Specialty_Products?GoodsId=@goods.GoodsId"><img src="~/images/shop_button.jpg"></a>*@</div>
                    </div>
                </div>
                <div class="xq_wrap">
                    <div class="tab_menu xq_menu">
                        <ul class="xq_ul">
                            <li class="selected">商品详情</li>
                            <li>用户评论</li>
                        </ul>
                    </div>
                    <div class="tab_box">
                        <div class="tab_w">
                            <table class="tab_con" width="670" border="0" cellspacing="0" cellpadding="0">
                                @*<caption>品牌名称：新疆和田大枣</caption>*@
                                <tbody>
                                    <tr>
                                        <td>产品参数：生产许可证编号：@GetGoodsDetailsInfo.ProductNo </td>
                                        <td>商品条形码: @GetGoodsDetailsInfo.ProductCode</td>
                                    </tr>
                                    <tr>
                                        <td>厂名：@CheckStartPlace.SupplierName </td>
                                        <td> 厂址：@CheckStartPlace.SupplierAddress</td>
                                    </tr>
                                    <tr>
                                        <td>厂家联系方式：@CheckStartPlace.SupplierTel </td>
                                        <td>
                                            保质期：
                                            @days.TotalDays<span>天</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>重量(g): @goods.Weight</td>
                                        <td>是否为有机食品: 否</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            等级:
                                            @if (GetGoodsDetailsInfo.GoodsLevel == 1)
                                            {
                                                <span>特级</span>
                                            }
                                        </td>
                                        <td> 产地: 中国 @CheckStartPlace.StartPlace</td>
                                    </tr>
                                    <tr>
                                        <td>生产日期: <span id="ProductDate">@GetGoodsDetailsInfo.ProductDate</span> 至 <span id="ValidityTime">@GetGoodsDetailsInfo.ValidityTime</span></td>
                                    </tr>
                                </tbody>
                            </table>
                            <center>
                                @foreach (var picture in SpecialtyPicture)
                                {
                                    if (goods.GoodsId == picture.GoodsId && picture.Is_Master == 0 && picture.Pic_Status == 0)
                                    {
                                        <img src="@picture.PictureUrl">
                                    }
                                }
                            </center>

                            @*<center><img src="~/images/xq02.jpg"></center>
                                <center><img src="~/images/xq03.jpg"></center>*@
                        </div>

                        @*用户评价*@
                        <div class="hide">
                            @foreach (var item in GetUsercommentsList)
                            {
                                <p>@item.UserComment_Content</p>
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        $("#ProductDate").text(Format($("#ProductDate").text(), "yyyy-MM-dd "));
        $("#ValidityTime").text(Format($("#ValidityTime").text(), "yyyy-MM-dd "));
    });
</script>

